System and method for accessing registers of a hardware device in a graphical program

ABSTRACT

A system and method for creating a graphical program which accesses registers of a hardware device. In one embodiment, a register access node or primitive may be included in a graphical program, such that when the graphical program is executed on the computer system, the register access node is operable to access (i.e., either read or write) registers of a hardware device in the computer system. The method may comprise first displaying a register access node in the graphical program in response to user input. For example, the user may select the register access node from a palette and drag and drop the register access node onto a window of the graphical program being created. The user may then configure the register access node to access one or more registers of a selected hardware device, e.g., by using a user interface for performing this configuration. In one embodiment, the computer may store a description of the hardware device, wherein the register access node uses the description of the hardware device to access registers of the hardware device during execution of the graphical program. In one embodiment, configuring the register access node may include displaying a list of registers or a list of fields of registers described in the description of the hardware device and receiving user input to select one or more of the registers from the list of registers. The list may also or instead comprise a list of mnemonic names of registers and/or a list of mnemonic names of fields in the registers. The user may thus configure the register access node to access selected registers described in the description of the hardware device.

RESERVATION OF COPYRIGHT

A portion of the disclosure of this patent document contains material towhich a claim of copyright protection is made. The copyright owner hasno objection to the facsimile reproduction by anyone of the patentdocument or the patent disclosure as it appears in the Patent andTrademark Office patent file or records, but reserves all other rightswhatsoever.

FIELD OF THE INVENTION

The present invention relates to graphical programming, and moreparticularly to a system and method for accessing registers of hardwaredevices in a graphical program.

DESCRIPTION OF THE RELATED ART

Traditionally, high level text-based programming languages have beenused by programmers in writing application programs. Many different highlevel programming languages exist, including BASIC, C, Java, FORTRAN,Pascal, COBOL, ADA, APL, etc. Programs written in these high levellanguages are translated to the machine language level by translatorsknown as compilers or interpreters. The high level programming languagesin this level, as well as the assembly language level, are referred toherein as text-based programming environments.

Increasingly, computers are required to be used and programmed by thosewho are not highly trained in computer programming techniques. Whentraditional text-based programming environments are used, the user'sprogramming skills and ability to interact with the computer systemoften become a limiting factor in the achievement of optimal utilizationof the computer system.

There are numerous subtle complexities which a user must master beforehe can efficiently program a computer system in a text-basedenvironment. The task of programming a computer system to model orimplement a process often is further complicated by the fact that asequence of mathematical formulas, mathematical steps or otherprocedures customarily used to conceptually model a process often doesnot closely correspond to the traditional text-based programmingtechniques used to program a computer system to model such a process. Inother words, the requirement that a user program in a text-basedprogramming environment places a level of abstraction between the user'sconceptualization of the solution and the implementation of a methodthat accomplishes this solution in a computer program. Thus, a useroften must substantially master different skills in order to bothconceptualize a problem or process and then to program a computer toimplement a solution to the problem or process. Since a user often isnot fully proficient in techniques for programming a computer system ina text-based environment to implement his solution, the efficiency withwhich the computer system can be utilized often is reduced.

Examples of fields in which computer systems are employed to interactwith physical systems are the fields of instrumentation, processcontrol, industrial automation, and simulation. Computer measurement andcontrol of devices such as instruments or industrial automation hardwarehas become increasingly desirable in view of the increasing complexityand variety of instruments and devices available for use. However, dueto the wide variety of possible testing and control situations andenvironments, and also the wide array of instruments or devicesavailable, it is often necessary for a user to develop a custom programto control a desired system.

As discussed above, computer programs used to control such systemstraditionally had to be written in text-based programming languages suchas, for example, assembly language, C, FORTRAN, BASIC, etc. Traditionalusers of these systems, however, often were not highly trained inprogramming techniques and, in addition, text-based programminglanguages were not sufficiently intuitive to allow users to use theselanguages without training. Therefore, implementation of such systemsfrequently required the involvement of a programmer to write softwarefor control and analysis of instrumentation or industrial automationdata. Thus, development and maintenance of the software elements inthese systems often proved to be difficult.

U.S. Pat. Nos. 4,901,221; 4,914,568; 5,291,587; 5,301,301; and5,301,336; among others, to Kodosky et al disclose a graphical systemand method for modeling a process, i.e., a graphical programmingenvironment which enables a user to easily and intuitively model aprocess. The graphical programming environment disclosed in Kodosky etal can be considered a higher and more intuitive way in which tointeract with a computer. A graphically based programming environmentcan be represented at a level above text-based high level programminglanguages such as C, Basic, Java, etc.

The method disclosed in Kodosky et al allows a user to construct adiagram using a block diagram editor. The block diagram may include aplurality of interconnected icons such that the diagram createdgraphically displays a procedure or method for accomplishing a certainresult, such as manipulating one or more input variables and/orproducing one or more output variables. The diagram may have one or moreof data flow, control flow and/or execution flow representations. Inresponse to the user constructing a diagram or graphical program usingthe block diagram editor, data structures may be automaticallyconstructed which characterize an execution procedure which correspondsto the displayed procedure. The graphical program may be compiled orinterpreted by a computer.

Therefore, Kodosky et al teaches a graphical programming environmentwherein a user places or manipulates icons and interconnects or “wiresup” the icons in a block diagram using a block diagram editor to createa graphical “program.” A graphical program for measuring, controlling,or modeling devices, such as instruments, processes or industrialautomation hardware, or for modeling or simulating devices, may bereferred to as a virtual instrument (VI). Thus, a user can create acomputer program solely by using a graphically based programmingenvironment. This graphically based programming environment may be usedfor creating virtual instrumentation systems, modeling processes,control, simulation and numerical analysis, as well as for any type ofgeneral programming.

In creating a graphical program, a user may create a front panel or userinterface panel. The front panel may include various user interfaceelements or front panel objects, such as controls and/or indicators,that represent or display the respective input and output that will beused by the graphical program or VI, and may include other icons whichrepresent devices being controlled. The front panel may be comprised ina single window of user interface elements, or may comprise a pluralityof individual windows each having a user interface element, wherein theindividual windows may optionally be tiled together. When the controlsand indicators are created in the front panel, corresponding icons orterminals may be automatically created in the block diagram by the blockdiagram editor. Alternatively, the user can place terminal icons in theblock diagram which may cause the display of corresponding front panelobjects in the front panel, either at edit time or later at run time. Asanother example, the front panel objects, e.g., the GUI, may be embeddedin the block diagram.

During creation of the block diagram portion of the graphical program,the user may select various function nodes or icons that accomplish hisdesired result and connect the function nodes together. For example, thefunction nodes may be connected in one or more of a data flow, controlflow, and/or execution flow format. The function nodes may also beconnected in a “signal flow” format, which is a subset of data flow. Thefunction nodes may be connected between the terminals of the varioususer interface elements, e.g., between the respective controls andindicators. Thus the user may create or assemble a graphical program,referred to as a block diagram, graphically representing the desiredprocess. The assembled graphical program may be represented in thememory of the computer system as data structures. The assembledgraphical program, i.e., these data structures, may then be compiled orinterpreted to produce machine language that accomplishes the desiredmethod or process as shown in the block diagram.

Input data to a graphical program may be received from any of varioussources, such as from a device, unit under test, a process beingmeasured or controlled, another computer program, or from a file. Also,a user may input data to a graphical program or virtual instrument usingfront panel controls. This input data may propagate through the dataflow block diagram or graphical program and appear as changes on theoutput indicators. In an instrumentation application, the front panelcan be analogized to the front panel of an instrument. In an industrialautomation application the front panel can be analogized to the MMI (ManMachine Interface) of a device. The user may adjust the controls on thefront panel to affect the input and view the output on the respectiveindicators. Alternatively, the front panel may be used merely to viewthe input and output, or just the output, and the input may not beinteractively manipulable by the user during program execution.

Thus, graphical programming has become a powerful tool available toprogrammers. Graphical programming environments such as the NationalInstruments LabVIEW product have become very popular. Tools such asLabVIEW have greatly increased the productivity of programmers, andincreasing numbers of programmers are using graphical programmingenvironments to develop their software applications. In particular,graphical programming tools are being used for test and measurement,data acquisition, process control, man machine interface (MMI),supervisory control and data acquisition (SCADA) applications,simulation, machine vision applications, and motion control, amongothers.

In many applications it is necessary or desirable to access registers ofa hardware device. Register-level programming provides a maximum amountof flexibility in creating hardware-related applications and/or defininginstrument functionality. Thus, it would be desirable to provide theability to access registers of a hardware device from a graphicalprogram.

Prior art methods of accessing hardware registers from graphicalprograms have relied on text-based input/output driver programs, whichwere custom developed for a specific hardware device and for a specifichardware/software platform. Every time the hardware device changedand/or the hardware/software platform changed, a new input/out driverprogram had to be developed. Also, prior art methods of accessinghardware registers using text-based programming has several limitations.As discussed above, text-based programs use non-user friendly, crypticcommands or instructions. For example, prior art programming methodsoften used binary or hexadecimal numbers for register addresses andintegers for data value. For example, “WRT 6F496 12345” may represent acommand to write an integer data value of 12345 to a register atlocation specified by a hexadecimal address 6F496. Errors in registeraddressing and/or in determining data type mismatch were difficult todetect and debug. This often resulted in ‘system crashes’ at run-timewith a resultant loss in productivity.

Therefore, improved methods are desired for enabling a graphical programto access registers of a hardware device.

SUMMARY OF THE INVENTION

One embodiment of the present invention comprises a system and methodfor creating a graphical program which accesses registers of a hardwaredevice. The system comprises a computer system including a display and auser input device. One or more hardware devices may be coupled to orincluded in the computer system, wherein each device has one or moreregisters.

In one embodiment, a register access node or primitive may be includedin a graphical program, such that when the graphical program is executedon the computer system, the register access node is operable to access(i.e., either read or write) registers of a hardware device in thecomputer system. The method may comprise first displaying a registeraccess node in the graphical program in response to user input. Forexample, the user may select the register access node from a palette anddrag and drop the register access node onto a window of the graphicalprogram being created.

The user may then configure the register access node to access one ormore registers of a selected hardware device, e.g., by using a userinterface for performing this configuration. In one embodiment, thecomputer may store a description of the hardware device, wherein theregister access node uses the description of the hardware device toaccess registers of the hardware device during execution of thegraphical program. In one embodiment, configuring the register accessnode may include displaying a list of registers or a list of fields ofregisters described in the description of the hardware device andreceiving user input to select one or more of the registers from thelist of registers. The list may also or instead comprise a list ofmnemonic names of registers and/or a list of mnemonic names of fields inthe registers. The user may thus configure the register access node toaccess selected registers described in the description of the hardwaredevice.

In the above description, a user may include a single register accessnode in a graphical program in order to access registers of a hardwaredevice. In various other embodiments, two or more nodes may be includedin the graphical program in order to perform hardware register access.For example, in creating the graphical program, the user may include afirst node in the graphical program. The user may then configure thefirst node to reference a selected hardware device. For example, theuser may select a description from a list of descriptions of availablehardware devices in the system. In one embodiment, the first node is ahardware refnum node, which may have a corresponding front panelelement. Alternately, the first node may be a hardware open node, whichoptionally may couple to a hardware refnum node.

The user may then include a register access node in the graphicalprogram in response to user input, wherein the register access node isoperable to access the hardware device. The user may then connect thefirst node to the register access node in response to user input,wherein the first node is operable to provide the description of thehardware device to the register access node. For example, the user mayuse a wiring tool to “wire up” the first node to the register accessnode, wherein a wire connecting the two nodes or icons is displayed inthe graphical program.

The user may then configure the register access node to access selectedregisters described in the description of the hardware device. Forexample, the user may right click to display a list of registersdescribed in the description of the hardware device, and then may selectone or more of the registers from the list of registers to be accessed,e.g., either read or written. In one embodiment, the user can selectmnemonic names of registers or mnemonic names of fields of registers.Also, the register access node may include one or more input terminalsfor writing registers of the hardware device or one or more outputterminals for reading registers of the hardware device. The user mayconnect these terminals to other nodes in the graphical program toperform any type of desired functionality.

Once the user has created the graphical program, the method mayconstruct execution instructions in response to the graphical program,wherein the execution instructions are executable to access registers ofthe hardware device. During execution of the graphical program, theregister access node may receive the hardware device description andaccess registers of the hardware device. Thus one embodiment of thepresent invention provides an improved system and method for creating agraphical program to access registers of a hardware device.

Another embodiment of the invention comprises a system and method forpropagating type information for hardware device nodes in a graphicalprogram. The user may display on a computer screen a first hardwaredevice node. For example, the first hardware device node may be includedin a block diagram of a graphical program. A hardware device node may beany of various types of nodes relating to hardware devices and mayperform any of various hardware-related functions in the graphicalprogram. Particular examples of hardware device nodes, such as ahardware device refnum node, a hardware open node, and a register accessnode, are discussed herein, and uses of these nodes to access registersof a hardware device are discussed in detail. It is noted, however, thatthe type propagation techniques described herein are not limited to anapplication that accesses hardware registers.

After displaying the first hardware device node, the user may associatethe first hardware device node with a hardware device. In oneembodiment, this comprises associating the first hardware device nodewith a hardware device class. For example, a plurality of hardwaredescriptions may be stored on the system, wherein each hardwaredescription defines a hardware device class. In one embodiment,information for each hardware device class may be comprised in a typelibrary. The user may display a list of hardware device classes, e.g.,by displaying a context menu when right-clicking on the first hardwaredevice node, and may choose a hardware device class from the list toassociate with the first hardware device node.

A second hardware device node may also be displayed in the graphicalprogram, and the user may connect the first hardware device node to thesecond hardware device node. For example, the first hardware device nodemay have an output terminal for providing information specifying ahardware device class with which the first hardware device node isassociated. The second hardware device node may have an input terminalfor receiving information specifying a hardware device class with whichto associate the second hardware device node. Thus, the user may displaya wire in the graphical program, wherein the wire connects the outputterminal of the first hardware device node to the input terminal of thesecond hardware device node.

In response to connecting the first hardware device node to the secondhardware device node, information may be propagated from the firsthardware device node to the second hardware device node, wherein theinformation specifies the hardware device class with which the firsthardware device node is associated. The second hardware device node maythen be automatically, i.e., programmatically, associated with the samehardware device class with which the first hardware device node isassociated.

The hardware device class with which the second hardware device node isthus associated may define one or more methods and/or properties. Forexample, in one instance, a property may correspond to a hardwareregister. The user may configure the second hardware device node withinformation specifying desired methods of the class with which toassociate the second hardware device node and/or desired properties ofthe class with which to associate the second hardware device node. Forexample, the user may display a list of the valid methods and/orproperties for the class, e.g., by displaying a context menu whenright-clicking on the second hardware device node, and may choose thedesired methods or properties from the list.

At execution time, an object of the hardware device class may beinstantiated, and the second hardware device node may invoke thespecified object methods and/or may get or set the specified objectproperties. For example, if a property corresponds to a hardwareregister, then getting or setting the property during execution of thegraphical program may cause reading a value from or writing a value to,respectively, the hardware register.

A method for performing type checking for a hardware device node in agraphical program is also described, e.g., to ensure that a method orproperty with which a hardware device node is associated is a validmethod or property for the hardware device class with which the hardwaredevice node is associated. If the method or property is not valid, forexample, then a runtime error could occur when the graphical program isexecuted.

According to one embodiment of this method, a first hardware device nodemay be displayed in the graphical program. The first hardware devicenode may then be associated with a first hardware device class. Forexample, as described above, the user may connect a wire to an inputterminal of the first hardware device node, wherein the wire originatesfrom the output terminal of another hardware device node and propagatesinformation specifying a hardware device class with which to associatethe first hardware device node, and the first hardware device node maybe automatically associated with this hardware device class. A method orproperty of the hardware device class may then be associated with thefirst hardware device node, similarly as described above.

The user may then desire to change the first hardware device node tohave an association with a new hardware device class. For example, theuser may disconnect the existing wire from the input terminal of thefirst hardware device node and may connect a new wire to the inputterminal. In response, a type checking method may be performed todetermine whether the property or method previously associated with thefirst hardware device node is valid for the new hardware device class.If the property or method is invalid, then an invalid condition may beindicated. For example, a wire specifying the new hardware device classmay be visually indicated as a “broken” wire, or the appearance of theblock diagram may be altered in various other ways. Also, execution ofthe graphical program may be prevented, to avoid a runtime error.

One embodiment of a type checking method to determine whether a propertyor method is a valid property or method for a given hardware deviceclass is described. This method may operate to determine a list of validmethods and properties for the hardware device class and then determinewhether the method or property is included in the list of valid methodand properties. For example, as noted above, the hardware device classinformation may be included in a type library. Thus, the respective typelibrary may be queried or examined to determine the list of validmethods and properties.

BRIEF DESCRIPTION OF THE DRAWINGS

A better understanding of the present invention can be obtained when thefollowing detailed description of the preferred embodiment is consideredin conjunction with the following drawings, in which:

FIGS. 1A and 1B illustrate representative instrumentation and processcontrol systems including various I/O interface options;

FIG. 2 is a block diagram of the computer system of FIGS. 1A and 1B;

FIG. 3 is a block diagram illustrating one embodiment of a graphicalprogramming development system usable to create graphical programs thataccess one or more hardware device registers;

FIG. 4 illustrates a palette including various function nodes related tohardware register access, referred to as hardware device nodes;

FIG. 5 is a flowchart diagram illustrating one embodiment of a methodfor creating a graphical program operable to access registers of ahardware device;

FIG. 6 is a more detailed flowchart illustrating one embodiment of amethod for creating a graphical program operable to access registers ofa hardware device;

FIG. 7 illustrates a hardware device refnum node displayed in a blockdiagram and illustrates a pop-up menu for the hardware device refnumnode including a “Select Hardware Class” menu item;

FIG. 8 illustrates a register access node displayed in a block diagramand illustrates a selectable list of properties of a hardware deviceclass which has been associated with the register access node, whereinthe properties correspond to hardware registers;

FIG. 9 illustrates a register access node displayed in a block diagram,wherein the register access node has been configured to write data totwo registers of a hardware device, and in response a pair of inputterminals for properties corresponding to these registers has beendisplayed on the node;

FIG. 10 is a flowchart diagram illustrating one embodiment of a methodfor propagating type information from a first hardware device node to asecond hardware device node;

FIG. 11 is a flowchart diagram illustrating one embodiment of a methodfor performing type checking for hardware device nodes; and

FIG. 12 is a flowchart diagram illustrating one embodiment of a methodfor determining whether a method/property currently selected for ahardware device node is a valid method/property for a hardware deviceclass with which the node is associated.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Incorporation By Reference

U.S. Pat. No. 5,847,953 titled “System and Method for Performing ClassChecking of Objects in a Graphical Data Flow Program,” issued Dec. 8,1998, whose inventors were Omid Sojoodi and Steven W. Rogers, and whichis assigned to National Instruments Corporation, is hereby incorporatedby reference in its entirety as though fully and completely set forthherein.

U.S. Pat. No. 5,905,649 titled “System and Method for PerformingInstrumentation Independent Virtual Instrumentation Functions UsingAttribute Nodes in a Graphical Data Flow Program,” issued May 18, 1999,whose inventors were Omid Sojoodi and Steven W. Rogers, and which isassigned to National Instruments Corporation, is hereby incorporated byreference in its entirety as though fully and completely set forthherein.

FIGS. 1A and 1B—Instrumentation and Industrial Automation Systems

FIGS. 1A and 1B illustrate exemplary systems which may store or executea graphical program which accesses registers of a hardware device. Forexample, the graphical program may perform an instrumentation function,such as a test and measurement function or an industrial automationfunction. It is noted that graphical programs that access hardwareregisters may be stored in or used by any of various other types ofsystems as desired and may implement any function or application asdesired. Thus, FIGS. 1A and 1B are exemplary only.

FIG. 1A illustrates an exemplary instrumentation control system 100. Thesystem 100 comprises a host computer 102 which connects to one or moreinstruments. The host computer 102 may comprise a CPU, a display screen,memory, and one or more input devices such as a mouse or keyboard asshown. The computer 102 connects through the one or more instruments toanalyze, measure, or control a unit under test (UUT) or process 150. Inone embodiment, the computer 102 may execute a graphical program thataccesses registers associated with one or more of the connectedinstruments.

The one or more instruments may include one or more of a GPIB instrument112 and associated GPIB interface card 122, a data acquisition board 114and associated signal conditioning circuitry 124, a VXI instrument 116,a PXI instrument 118, a video device 132 and associated imageacquisition card 134, a motion control device 136 and associated motioncontrol interface card 138, and/or one or more computer based instrumentcards 142, among other types of devices.

The GPIB instrument 112 may be coupled to the computer 102 via the GPIBinterface card 122 comprised in the computer 102. In a similar manner,the video device 132 may be coupled to the computer 102 via the imageacquisition card 134, and the motion control device 136 may be coupledto the computer 102 through the motion control interface card 138. Thedata acquisition board 114 may be coupled to the computer 102, and mayinterface through signal conditioning circuitry 124 to the UUT. Thesignal conditioning circuitry 124 preferably comprises an SCXI (SignalConditioning eXtensions for Instrumentation) chassis comprising one ormore SCXI modules 126.

The GPIB card 122, the image acquisition card 134, the motion controlinterface card 138, and the DAQ card 114 are typically plugged in to anI/O slot in the computer 102, such as a PCI bus slot, a PC Card slot, oran ISA, EISA or MicroChannel bus slot provided by the computer 102.However, these cards 122, 134, 138 and 114 are shown external tocomputer 102 for illustrative purposes.

The VXI chassis or instrument 116 may be coupled to the computer 102 viaa VXI bus, MXI (e.g., MXI-3) bus, or other serial or parallel busprovided by the computer 102. The computer 102 preferably includes VXIinterface logic, such as a VXI, MXI or GPIB interface card (not shown),which interfaces to the VXI chassis 116. The PXI chassis or instrumentis preferably coupled to the computer 102 through the computer's PCIbus.

A serial instrument (not shown) may also be coupled to the computer 102through a serial port, such as an RS-232 port, USB (Universal Serialbus) or IEEE 1394 or 1394.2 bus, provided by the computer 102.

In typical instrumentation control systems an instrument will not bepresent of each interface type, and in fact many systems may only haveone or more instruments of a single interface type, such as only GPIBinstruments. The one or more instruments are coupled to the unit undertest (UUT) or process 150, or are coupled to receive field signals,typically generated by transducers. The system 100 may be used in a dataacquisition and control application, in a test and measurementapplication, a process control application, or a man-machine interfaceapplication.

FIG. 1B illustrates an exemplary industrial automation system 160. Theindustrial automation system 160 is similar to the instrumentation ortest and measurement system 100 shown in FIG. 1A. Elements which aresimilar or identical to elements in FIG. 1A have the same referencenumerals for convenience. The system 160 may comprise a computer 102which connects to one or more devices or instruments. The computer 102may comprise a CPU, a display screen, memory, and one or more inputdevices such as a mouse or keyboard as shown. The computer 102 mayconnect through the one or more devices to a process or device 150 toperform an automation function, such as MMI (Man Machine Interface),SCADA (Supervisory Control and Data Acquisition), portable ordistributed data acquisition, process control, advanced analysis, orother control. In one embodiment, the computer 102 may execute agraphical program that accesses registers associated with one or more ofthe connected devices or instruments, such as a graphical program thatis involved with the automation function performed by the automationsystem 160.

The one or more devices may include a data acquisition board 114 andassociated signal conditioning circuitry 124, a PXI instrument 118, avideo device 132 and associated image acquisition card 134, a motioncontrol device 136 and associated motion control interface card 138, afieldbus device 170 and associated fieldbus interface card 172, a PLC(Programmable Logic Controller) 176, a serial instrument 182 andassociated serial interface card 184, or a distributed data acquisitionsystem, such as the Fieldpoint system available from NationalInstruments, among other types of devices.

The DAQ card 114, the PXI chassis 118, the video device 132, and theimage acquisition card 136 are preferably connected to the computer 102as described above. The serial instrument 182 is coupled to the computer102 through a serial interface card 184, or through a serial port, suchas an RS-232 port, USB, or IEEE 1394 or 1394.2 provided by the computer102. The PLC 176 couples to the computer 102 through a serial port,Ethernet port, or a proprietary interface. The fieldbus interface card172 is preferably comprised in the computer 102 and interfaces through afieldbus network to one or more fieldbus devices. Each of the DAQ card114, the serial card 184, the fieldbus card 172, the image acquisitioncard 134, and the motion control card 138 are typically plugged in to anI/O slot in the computer 102 as described above. However, these cards114, 184, 172, 134, and 138 are shown external to computer 102 forillustrative purposes. In typical industrial automation systems a devicewill not be present of each interface type, and in fact many systems mayonly have one or more devices of a single interface type, such as onlyPLCs. The devices are coupled to the device or process 150.

Referring again to FIGS. 1A and 1B, the computer system(s) 102preferably includes a memory medium(s) on which one or more computerprograms or software components according to one embodiment of thepresent invention are stored. For example, the memory medium may store agraphical programming development environment application which isoperable to create graphical programs that access registers of hardwaredevices. For example, as described below, the graphical programmingdevelopment environment application may provide one or more nodesrelated to hardware register access, which users can include ingraphical programs in order to access registers of hardware devices. Thememory medium may also store a graphical program that includes nodes foraccessing hardware registers. The memory medium may also storenon-executable data which enables the graphical program to perform thehardware register access, such as a description of the hardwaredevice(s) to be accessed.

The term “memory medium” is intended to include an installation medium,e.g., a CD-ROM, floppy disks 104, or tape device, a computer systemmemory or random access memory such as DRAM, SRAM, EDO RAM, Rambus RAM,etc., or a non-volatile memory such as a magnetic media, e.g., a harddrive, or optical storage. The memory medium may comprise other types ofmemory as well, or combinations thereof.

In addition, the memory medium may be located in a first computer inwhich the programs are executed, or may be located in a second differentcomputer which connects to the first computer over a network, such asthe Internet. In the latter instance, the second computer may providethe program instructions to the first computer for execution. Also, thecomputer system 102 may take various forms, including a personalcomputer system, mainframe computer system, workstation, networkappliance, Internet appliance, personal digital assistant (PDA),television system or other device. In general, the term “computersystem” can be broadly defined to encompass any device having at leastone processor which executes instructions from a memory medium.

FIG. 2—Computer System Block Diagram

FIG. 2 is a block diagram of the computer system illustrated in FIGS. 1Aand 1B. It is noted that any type of computer system configuration orarchitecture can be used as desired, and FIG. 2 illustrates arepresentative PC embodiment. It is also noted that the computer systemmay be a general purpose computer system as shown in FIGS. 1A and 1B, acomputer implemented on a VXI card installed in a VXI chassis, acomputer implemented on a PXI card installed in a PXI chassis, or othertypes of embodiments. The elements of a computer not necessary tounderstand the present invention have been omitted for simplicity.

The computer 102 includes at least one central processing unit or CPU160 which is coupled to a processor or host bus 162. The CPU 160 may beany of various types, including an x86 processor, e.g., a Pentium class,a PowerPC processor, a CPU from the SPARC family of RISC processors, aswell as others. Main memory 166 is coupled to the host bus 162 by meansof memory controller 164.

The main memory 166 may store computer programs according to oneembodiment of the present invention. The main memory 166 also storesoperating system software as well as the software for operation of thecomputer system, as well known to those skilled in the art. The computerprograms of the present invention will be discussed in more detailbelow.

The host bus 162 is coupled to an expansion or input/output bus 170 bymeans of a bus controller 168 or bus bridge logic. The expansion bus 170is preferably the PCI (Peripheral Component Interconnect) expansion bus,although other bus types can be used. The expansion bus 170 includesslots for various devices such as the data acquisition board 114 (ofFIG. 1A) and a GPIB interface card 122 which provides a GPIB businterface to the GPIB instrument 112 (of FIG. 1A). The computer 102further comprises a video display subsystem 180 and hard drive 182coupled to the expansion bus 170.

As shown, a reconfigurable instrument 190 may also be connected to thecomputer 102. The reconfigurable instrument 190 may include configurablelogic, such as a programmable logic device (PLD), e.g., an FPGA, or aprocessor and memory, which may execute a real time operating system.According to one embodiment of the invention, a graphical program thataccesses a hardware register may be downloaded and executed on thereconfigurable instrument 190. For example, a graphical programmingdevelopment system with which the graphical program is associated mayprovide support for downloading a graphical program for execution onconfigurable logic in a real time system. In various embodiments, theconfigurable logic may be comprised on an instrument or device connectedto the computer through means other than an expansion slot, e.g., theinstrument or device may be connected via an IEEE 1394 bus, USB, orother type of port. Also, the configurable logic may be comprised on adevice such as the data acquisition board 114 or another device shown inFIG. 1A.

Graphical Programming Environment

FIG. 3 is a block diagram illustrating one embodiment of a graphicalprogramming development system usable to create graphical programs thataccess one or more hardware device registers. It is noted that theelements of FIG. 3 are exemplary only, and other graphical programmingdevelopment systems may differ in various ways.

In one embodiment, a programmer employs a front panel editor 62 and ablock diagram editor 64 of a graphical programming development system toproduce a graphical program. In an instrumentation application, thegraphical program may be referred to as a virtual instrument (VI) 50.The VI 50 may include one or more nodes or blocks that may be connectedor coupled together as specified by the user. As shown, a registeraccess node 51 may be included in the VI 50, wherein the register accessnode 51 is operable to access registers of a selected hardware device 54during execution of the VI 50. The VI 50 may be executed by an executionsubsystem 56 of the graphical programming development system to controlor access a hardware device 54. The device 54 is illustrative of devicessuch as those of FIGS. 1A and 1B.

The graphical programming development system may provide various frontpanel controls or graphical user interface (GUI) elements 74. The frontpanel editor 62 is operable to generate a front panel or GUI for the VI50, using one or more of the front panel controls 74.

The graphical programming development system may also provide variousfunction nodes 66 that may be included, using the block diagram editor64, in graphical programs to perform various functions. For example, theregister access node 51 is one example of a function node. FIG. 4illustrates a palette including various function nodes related tohardware register access, as provided by one embodiment of a graphicalprogramming development system. In one embodiment, the function nodes 66comprise a hardware device refnum, a hardware device open node, ahardware device close node and a register access node 51. In anotherembodiment the open and close nodes are not used. Also, in anotherembodiment a single register access node may perform the functionalityof accessing registers of the hardware device, with no need for aseparate hardware device refnum, hardware device open node, or otherseparate node.

The graphical programming development system may utilize hardware devicedescriptions 70 to acquire information used in accessing registers ofhardware devices. In one embodiment, the hardware device descriptions 70may include specifications for the hardware device such as registertype, mnemonic names of fields of registers, register layout, offsetrelative to location of hardware, data types, read only or read/write,bit fields, enumerated constants, etc. In another embodiment, thehardware device descriptions 70 may include mnemonic names of registers,types of registers, fields of registers, mnemonic names of fields ofregisters, number of registers, addresses of registers, number of bitsper register, etc.

The execution subsystem 56 may execute executable instructionsconstructed from a block diagram and/or front panel of the VI 50. Formore information about one embodiment of the execution subsystem 56,please refer to U.S. Pat. No. 5,481,741.

When the VI 50 is executed, the register access node 51, included in VI50, may access or control the device or instrument 54. Stated anotherway, the register access node 51 is executable to access (read or write)hardware registers in the device or instrument 54. In one embodiment,the register access node 51 may access hardware registers through aprogram abstraction layer (PAL) 53. The PAL software, which interfacesdirectly with the hardware device, provides a standard applicationprogramming interface (API) for the VI 50. The program abstraction layer53 includes executable functions, which are called by the VI 50 toperform operations in order to control the instrument 54.

The graphical programming development system of FIG. 3 provides a numberof benefits for the development of graphical programs that accesshardware device registers. These benefits include gaining a directread/write access to registers in a hardware device without the need towrite specific I/O drivers for the hardware device. This may result inthe reduction of the development time required to create the graphicalprogram, as well as reduction of the number of code defects in thegraphical program. Another benefit is the simplicity of programming. Thesimplicity makes the development of a graphical program, such as aninstrumentation control program, more practical for a larger number ofpeople, e.g., those who might not have the skills, or resources todevelop the skills, to develop programs according to more conventionaltext-based methods. Also, as discussed below, in one embodiment thegraphical programming development system may utilize an object-orientedsystem design, which allows for class propagation, class checking, andtype checking in the graphical programming environment.

Creating a Graphical Program that Accesses a Hardware Register(s)

FIG. 5 is a flowchart diagram illustrating one embodiment of a methodfor creating a graphical program operable to access registers of ahardware device.

In step 80, a register access node may be displayed in the graphicalprogram. For example, as described above, a graphical programmingdevelopment system may provide various nodes for inclusion in the blockdiagram of a graphical program. Thus, a user may display the registeraccess node in the graphical program's block diagram, e.g., by selectingthe register access node from a palette or menu.

In step 82, the register access node may be configured to access one ormore registers of a hardware device. In various embodiments, thisconfiguration may be performed in any of various ways. In oneembodiment, the graphical programming development system may provide adialog box or other type of user interface for performing thisconfiguration. For example, the user may select the desired hardwaredevice, select the register(s) of the device to access, specify whetherto read from or write to the register(s), etc. In step 82, the registeraccess node may also be connected or wired to other portions of thegraphical program. For example, if data is to be written to theregister, a data value may be wired from another part of the graphicalprogram into an input terminal of the register access node. If data isto be read from the register, an output terminal of the register accessnode may be wired into another part of the graphical program. Also, asdescribed below with reference to FIG. 6, in one embodiment, specifyingwhich hardware device and/or which register(s) to access may compriseconnecting the register access node to another node, such as a hardwareopen node.

In step 84, the graphical program may be executed.

In step 86, the register access node may access the one or moreregisters of the hardware device, as configured in step 82. In otherwords, including the register access node in the graphical program andconfiguring the register access node to access the specified hardwaredevice register(s) causes the inclusion of certain executable code inthe graphical program, such that when this code is executed duringexecution of the graphical program, the specified hardware deviceregister(s) is accessed.

FIG. 6 is a more detailed flowchart illustrating one embodiment of amethod for creating a graphical program operable to access registers ofa hardware device.

In step 202, one or more hardware device descriptions may be stored. Inone embodiment, as described above, hardware device descriptions 70 mayinclude mnemonic names of registers, types of registers, fields ofregisters, mnemonic names of fields of registers, number of registers,addresses of registers, number of bits per register, etc. In anotherembodiment, the hardware device descriptions 70 may includespecifications for the hardware device such as register type, mnemonicnames of fields of registers, register layout, offset relative tolocation of hardware, data types, read only or read/write, bit fields,enumerated constants, etc.

The hardware device descriptions may be stored in any of various waysand in any desired format. For example, the descriptions may comprisetext data, binary data, XML data, or any other type of data. In oneembodiment, the descriptions are stored in a type library.

In step 204, a hardware device refnum node may be displayed, e.g., inresponse to user input. The hardware device refnum node provides, as anoutput of the node, a reference to a hardware device which is desired tobe accessed. In one embodiment, in step 204 the user drops or places ahardware device icon on a front panel, and in response the block diagrameditor 64 displays a corresponding hardware device class refnum icon inthe block diagram. In another embodiment, the user may drop or place ahardware device refnum node directly in the block diagram of thegraphical program.

In step 206 the user may then select a hardware device description toassociate with the hardware device refnum node. In one embodiment, theuser “right clicks” on the hardware device refnum node, and in response,a list of available hardware device descriptions (e.g., the descriptionsstored in step 202) are displayed. The user may then select the desiredhardware device description from the list. The hardware device refnumnode receives the user input and associates the user-selected hardwaredevice with the hardware device refnum node in step 206. Thus, afterstep 206, the hardware device refnum node comprises a reference to theselected hardware device description.

In step 208, the user then “drops” or “places” a hardware device opennode in the block diagram, In other words, in response to user input theblock diagram editor 64 displays a hardware device open node icon in thegraphical program in step 208.

In step 210 the user connects the hardware device refnum node and thehardware device open node, e.g., by wiring an output terminal of thehardware device refnum node to an input terminal of the hardware deviceopen node. Thus in step 210 the block diagram editor 64 displays a wireconnecting the hardware device refnum and the hardware device open nodein step 210 in response to user input. This connection made in step 210operates, during execution of the graphical program, to provide theselected hardware device description to the hardware device open node.In one embodiment, the hardware device refnum passes class and typelibrary information for the selected hardware device to the hardwareopen node, and, during execution of the graphical program, the hardwaredevice open node operates to open or instantiate an object based on thehardware device class and type library information.

In step 212 the user “drops” or places a register access node in theblock diagram and in response the block diagram editor 64 displays aregister access node.

In step 214 the user may connect the hardware device open node and theregister access node, e.g., by wiring an output terminal of the hardwaredevice open node to an input terminal of the register access node. Thusin step 214 the block diagram editor 64 displays a wire connecting thehardware device open node and the register access node in response touser input. During execution of the graphical program, the hardwaredevice open node provides information regarding the hardware devicebeing accessed to the register access node.

In step 216 the user may configure the register access node to accessone or more registers of the hardware device whose hardware devicedescription is received from the open node. Configuring this access maycomprise configuring the node to read from and/or write to the specifiedregister(s). The node may be configured in various ways, depending onthe particular embodiment. In one embodiment, the user may “right click”on the register access node to display a list of registers, e.g.,registers defined in the hardware description. The user may then selectthe desired registers. In one embodiment, a pair of input/outputterminals for each selected register may appear on the register accessnode in the block diagram. The user may then connect these input/outputterminals as desired to other nodes in the block diagram, e.g., toindicate reading from or writing to the corresponding registers.

As noted above, in one embodiment, the hardware open node instantiatesan object representing the hardware device. In this instance, theconfiguration of step 216 may involve selecting one or more propertiesof the object and associating these properties with the register accessnode, e.g., by configuring the register access node to get or set theproperties. For example, a property may correspond to a register of thedevice, e.g., may specify a mnemonic name of a register. The user mayselect multiple properties, for example as defined in hardware devicedescriptions 70, to associate with the register access node.

In step 218 the graphical programming environment then constructsexecution instructions based on the VI or graphical program comprisingthe connected hardware device refnum node, the hardware device opennode, the register access node, and other function blocks, sub-diagrams,or other elements the user chose to include in the graphical program.The graphical programming environment then executes the executioninstructions in step 220. The time during which a user is creating orediting a VI 50 by dropping nodes and wiring them together is referredto as “edit-time.” The time when instructions of the VI 50 are executedis referred to as “run-time”.

In an alternate embodiment, the user creates the graphical programhaving a register access node without using a hardware device open node.For example, the user may connect the hardware device refnum nodedirectly to the register access node. In this embodiment, the registeraccess node receives the hardware device description information andperforms the function of the hardware open node in addition to itsregister access functions.

In another alternate embodiment, the user creates the graphical programhaving a register access node without using either a hardware deviceopen node or a hardware device refnum node. In this embodiment, the usermay drop or place the register access node in the block diagram and thenmay configure the register access node with the desired hardware deviceto be accessed. For example, the user may “right click” on the registeraccess node and select the hardware device to be accessed from a list ofavailable hardware devices. Once the device has been specified, thedesired registers to access may then be chosen.

As described above, in one embodiment, a hardware device refnum node maybe associated with a hardware device class, e.g., a class described in atype library. FIG. 7 shows a hardware device refnum node displayed in ablock diagram. FIG. 7 also shows a pop-up menu for the hardware devicerefnum node including a “Select Hardware Class” menu item. The user mayright click, e.g., using a mouse, on the hardware device refnum node inorder to see the pop-up menu. For example, in response to the rightclick, the hardware device refnum node may query an object manager for alist of stored hardware device descriptions 70 associated with thehardware devices present in the system. For example, in one embodimentthe object manager may query a registry of the host computer to obtain alist of the hardware device type libraries present in the system,wherein each hardware device type library defines a hardware deviceclass. The hardware device refnum node may then display the list ofhardware device classes in the pop-up menu.

The user may then select a hardware device class from the list displayedby the hardware device refnum node. The hardware device refnum node mayinclude a refnum output terminal, to which a wire may be connected. Atedit-time, the hardware device refnum node provides, at its outputterminal, a type descriptor, which specifies the selected hardwaredevice class, and the type library to which the hardware device classbelongs. Type descriptors are described in detail below.

As described above, the user may then include a hardware device opennode on the block diagram and connect the hardware device refnum nodeoutput to a refnum input terminal of the hardware device open node. (Asnoted above, in an alternate embodiment, the hardware device open nodealso serves the function of the hardware device refnum node by receivingthe hardware device class information as user input.) As discussedbelow, the type descriptor received from the hardware device refnum nodemay be used in performing type propagation checking.

The hardware device open node also includes a refnum output terminal, towhich a wire may be connected. At edit-time, the hardware device opennode forwards the type descriptor received at its refnum input terminalto its refnum output terminal. The type descriptor is forwarded on aconnected wire to all other nodes connected to the wire. (At run-time,the hardware device open node instantiates an object based on thehardware device class and type library information received from thehardware device refnum node, and passes a reference to this object viaits refnum output terminal.)

As described above, the user may include a register access node on theblock diagram and connect the refnum output terminal of the hardwaredevice open node to a refnum input terminal of the register access node.It is noted that the refnum input terminal of the register access nodemay instead be connected to other wires which provide the reference tothe object and type descriptor rather than receiving the reference fromthe refnum output terminal of the hardware open node. For example, therefnum input terminal of the register access node may be connected tothe refnum output terminal of another hardware device node of the sameobject class.

At edit-time, the register access node receives a type descriptor viaits refnum input terminal so that the register access node may performtype propagation checking. The register access node also uses theinformation in the type descriptor at edit-time to perform otheroperations, such as displaying hardware device property lists asdescribed below. (At run-time, the register access node receives areference to the instantiated object via its refnum input terminal sothat the register access node may set or get properties (accessregisters) of the instantiated object.)

The register access node also includes a refnum output terminal. Theregister access node passes the information received on its refnum inputterminal to its refnum output terminal, i.e., the type descriptor, atedit-time and passes the object reference at run-time.

As described above, the hardware device open node (or other hardwaredevice object node to which the register access node is connected)provides information on the selected hardware device class and selectedtype library to the register access node. The hardware device class andselected type library information may be provided as a type descriptorwhich includes the hardware device description information.

The user may select a “Properties” menu item by right-clicking on theregister access node to display a popup menu. In response to selectingthis menu item, the register access node may display a list ofproperties associated with the selected hardware device class. Thehardware device class and type library information received from thehardware open node may be used in querying an object manager for thislist of properties. In response, the object manager may query theselected type library for a list of properties of the specified hardwaredevice class. The register access node uses the information receivedfrom the object manager to display the list of properties of theselected hardware device class, as shown in FIG. 8. The user may thenselect from the displayed list of properties. For example, as describedabove, each property may correspond to a register, and the user mayselect the desired registers to access. In the example of FIG. 8, theuser may select desired registers of a PCI MIO 16 E 4 DAQ card devicewith which the register access node is associated.

For each selected property, the register access node may display aterminal for the selected property, as shown in FIG. 9. If the property(register) may be set, i.e., written, the register access node displaysan input terminal. If the property (register) may be gotten, i.e., read,the register access node displays an output terminal. Preferably, aproperty (register) may be set to be readable or writable in response touser input. The user may then connect or wire the input and/or outputterminals as desired to other values or nodes in the block diagram. Inthe example of FIG. 9, the register access node has been configured towrite values to two registers of a PCI MIO 16 E 4 device.

Graphical Program Execution

Once the user has created the graphical program, the graphicalprogramming development system may create execution instructions for thegraphical program in accordance with the block diagram. Constructing theexecution instructions may comprise generating machine languageinstructions into an executable program. Alternatively, constructing theexecution instructions may comprise generating programming languageinstructions, such as C language instructions, and compiling theprogramming language instructions into an executable program. Once theexecution instructions have been generated, the user may request thegraphical programming development system to execute the instructions. Inresponse, the execution subsystem 56 (of FIG. 3) may executes theexecution instructions of the graphical program. In one embodiment, theexecution instructions are interpreted rather than compiled.

For each hardware device node and other node in the block diagram,corresponding execution instructions may be generated. For the hardwaredevice open node, the corresponding execution instructions may beoperable to instantiate an object from the hardware device classindicated by the hardware device refnum node. For the register accessnode, the execution instructions may be operable to set and/or get thespecified properties of the instantiated object, which may cause thecorresponding hardware registers to receive the values supplied atcorresponding property input terminals and/or cause values from thecorresponding hardware registers to be provided to the correspondingproperty output terminals.

Thus, in one embodiment the method enables a user to access registers ofhardware devices by means of a graphical programming development systemoperable to instantiate objects from hardware device classes and invokemethods and properties of the hardware device objects.

Type Propagation Checking

Type Descriptor

As described above, type propagation checking may be performed atedit-time when wires are connected to input terminals of hardware devicenodes. In one embodiment, each wire and terminal in a block diagram mayhave an associated data type. The programming environment may keep trackof the data type in a structure in memory called a type descriptor. Forexample, the type descriptor may comprise a string of word integers thatdescribe the data type. In one embodiment the generic format of a typedescriptor is:

-   -   <size> <typecode>.

Table 1 lists three of the supported data types, the type codes, andtype descriptors in one embodiment of the programming environment.

TABLE 1 Data Type Type Code Type Descriptor Long 0x03 0004 xx03 Inte-ger Han- 0x31 0006 xx31 <kind> dle Array 0x40 <nn> 0x40 <k> <kdimensions> <element type descriptor>

When a wire is initially connected to a terminal, the wire takes on thedata type of the terminal, i.e., the programming environment creates atype descriptor for the wire. When the user connects this wire toanother terminal in the block diagram at edit-time, the programmingenvironment performs type propagation checking by comparing the typedescriptor of the wire with the type descriptor of the terminal. If thetype descriptors do not match, then a type conflict error is generated.In one embodiment, the programming environment performs type propagationchecking on each wire and terminal in the block diagram each time achange is made to the diagram. That is, type descriptors are propagatedon the wires of the block diagram at edit-time in order to perform typepropagation checking.

Thus a type descriptor may be defined for a hardware device refnumterminal and used in type propagation checking. The hardware devicerefnum terminal type descriptor may include an identifier for thehardware device class associated with the hardware device refnum nodeand an identifier for the type library for the hardware device class. Inone embodiment, the hardware device refnum type descriptor has theformat:

-   -   <size> <RefnumCode> <HardwareRefnumKind> <HardwareType>    -   <no of int16's> <kCoClassCLSID> <CLSID of created object>    -   <kTypeLibCLSID> <CLSID of type library> <DISPID>

The <size> byte of the type descriptor is as described above. The<refnumCode> is the type code for a refnum. The <HardwareRefnumKind>value distinguishes this refnum from other refnums as a hardware devicerefnum. The <HardwareType> indicates the hardware type, such as the<kStHWDevType> value, which indicates a static hardware device type. The<no of int16's> field indicates the number of 16 bit words which follow.The <kCoClassCLSID> value indicates the following 128 bits are a classidentifier. The <CLSID of created object> is a unique 128 bit numberassociated with the particular hardware device class which the hardwaredevice refnum references. The <kTypeLibCLSID> value indicates thefollowing 128 bits are a type library identifier. The <CLSID of typelibrary> is a unique 128 bit number associated with the particular typelibrary to which the hardware device class belongs. The <DISPID> is aDispatch ID, which is a long integer to uniquely specify a class withina type library. The Dispatch ID is associated with the MicrosoftIDispatch interface for dispatch methods and properties. The Dispatch IDis unique within a type library.

In one embodiment, the hardware device nodes may be implemented asobjects having associated methods, including a type propagation checkingmethod. Thus, the block diagram editor 64 may invoke the typepropagation checking method when necessary to perform type propagationchecking. For example, when the user connects a wire to a terminal of ahardware device node, the type propagation method of the node may beinvoked and the type descriptor of the wire being connected to theterminal may be passed as an argument to the type propagation method.The information in the type descriptor enables the type propagationmethod to determine class conflicts in the block diagram.

Thus, the method may advantageously perform type propagation checking todetermine program correctness when wiring hardware device functionnodes. This checking advantageously prevents run-time errors, whichwould occur if the user attempted to invoke an invalid method orproperty for the hardware device class selected.

Propagating Type Information

FIG. 10 is a flowchart diagram illustrating one embodiment of a methodfor propagating type information from a first hardware device node to asecond hardware device node. The hardware device nodes may be any ofvarious types of nodes relating to hardware devices, such as thehardware refnum node, hardware open node, and register access nodesdiscussed above, or any other type of hardware device node. It is notedthat the method of FIG. 10 may be used for performing type propagationchecking for a graphical program that performs any of varioushardware-related functions, and is not limited to an application whichaccesses hardware registers.

In step 240, a first hardware device node may be displayed, and the nodemay be associated with a particular hardware device or hardware deviceclass. For example, the first hardware device node may be a hardwaredevice refnum node such as described above, and the user may display alist of hardware device classes stored in the system and may associate aclass from this list with the node.

In step 242, a second hardware device node may be displayed. Forexample, the second hardware device node may be a hardware open nodesuch as described above.

In step 244, the first hardware device node may be connected to thesecond hardware device node, wherein this connection serves to associatethe second hardware device node with the same hardware device class withwhich the first hardware device node is associated. For example, asdescribed above, the first hardware device node may have a refnum outputterminal that provides information specifying the associated hardwaredevice class. The second hardware device node may have a refnum inputterminal which may be connected to this refnum output terminal toreceive the hardware device class information. Thus, in the blockdiagram, a wire from the first hardware device node to the secondhardware device node may be displayed.

In step 246, the hardware device class information may be propagatedfrom the first hardware device node to the second hardware device node.That is, the second hardware device node receives the hardware deviceclass information from the first hardware device node. As describedabove, the information may be comprised in a hardware device refnum typedescriptor. The second hardware device node may then be associated withthe hardware device class specified by the type descriptor.

In the example given above, the first hardware device node is a hardwaredevice refnum node, and the second hardware device node is a hardwareopen node, but, as noted, the first and second nodes may be any ofvarious types of hardware device nodes. In the case of the hardwaredevice refnum node, the node has a refnum output terminal that canprovide the hardware class information to other nodes but does not havea refnum input terminal that can receive hardware class information fromother nodes (since the user initially associates the hardware class withthe hardware device refnum node). In other cases, the first hardwaredevice node may have both a refnum output terminal and a refnum inputterminal. For example, after connecting a hardware open node's refnuminput terminal to a hardware device refnum node's refnum outputterminal, the user may then connect a register access node's refnuminput terminal to the hardware open node's refnum output terminal. Inthis instance, the hardware open node may be considered as the firsthardware device node, and the register access node may be considered asthe second hardware device node. Thus, hardware device class informationwhich the hardware open node initially received from the hardware devicerefnum node may subsequently be passed to other nodes, therebypropagating the hardware device class information through a chain ofhardware device nodes.

Checking Type Information for Hardware Device Nodes

As described above, at edit-time a hardware device node may beassociated with a particular hardware device class. At run time, thehardware device node may receive an instantiated object of this class(or may receive a reference to the instantiated object). The hardwaredevice node may be configured to invoke various methods on the object orto get/set various properties of the object. For example, as describedabove, the hardware device node may be a register access node that isconfigured to get/set object properties that reference hardware deviceregisters. Thus, it would be desirable to enable the programmingenvironment to perform type propagation checking to ensure that themethods and/or properties configured for the hardware device node arevalid methods/properties for the hardware device class with which thehardware device node is associated. The hardware class informationpropagated as described above with reference to FIG. 10 may be used toperform this check.

FIG. 11 is a flowchart diagram illustrating one embodiment of a methodfor performing type checking for hardware device nodes. In step 600, ahardware device node may be associated with a first hardware deviceclass. This association may occur in various ways. For example, asdescribed above, the user may connect a wire from a refnum outputterminal of another hardware device node to a refnum input terminal ofthis hardware device node, and hardware device class information fromthe other node may be propagated to this node, thus associating thisnode with the same hardware device class.

In step 602, a method or property of the first hardware device class maybe selected for the hardware device node, so that when the graphicalprogram is executed the hardware device node is operable to invoke theselected method or get/set the selected property. As described above,the programming environment may be operable to determine a list of validmethods/properties for the first hardware device class, e.g., byquerying an object manager.

In step 604, the hardware device node may be changed to have anassociation with a second hardware device class. For example, the usermay disconnect the wire that was originally connected to the hardwaredevice node's refnum input terminal and may connect a new wire to theterminal. For example, the new wire may originate from a differenthardware device node that is associated with the second hardware deviceclass, which may be different than the first hardware device class.

In step 606, a type checking method may be performed, to determinewhether the method/property that was selected in step 602 is a validmethod/property for the second hardware device class. One embodiment ofsuch a method is described below with reference to FIG. 12.

In step 608, the result of the type checking method is checked. If itwas determined that the method/property is valid, then in step 614 avalid condition may be indicated, e.g., the graphical program may appear“normal” and the programming environment may not indicate an error.

If the method/property was determined to be invalid, then in step 610 aninvalid condition may be indicated. For example, the programmingenvironment may visually or otherwise indicate a type error, e.g., bydisplaying a “broken” wire to the refnum input terminal of the hardwaredevice node, or changing the color of the wire, etc., or may indicatethe problem in any of various other ways, e.g., by changing a color oftext in the node, wherein the text indicates the currently selectedmethod/property. Also, as shown in step 612, the programming environmentmay prevent execution of the graphical program until the type error isfixed.

It is noted that type information for hardware device nodes may bechecked at other times in addition to when the hardware device class fora node is changed. For example, the programming environment may beoperable to track changes to a hardware device class itself, e.g., to atype library associated with the hardware device class, and mayautomatically perform type checking when the class is changed.

As an example of applying the above-described method, suppose that aregister access node is currently configured with an input wirespecifying hardware device class information to its refnum inputterminal. Suppose that the specified hardware device class has anassociated property “REG1” that references a REG1 register of thehardware device corresponding to the hardware device class, and theregister access node has been configured to set the “REG1” property, inorder to write to the REG1 register.

If the input wire to the refnum input terminal of the register accessnode is then replaced with another wire, then the type informationassociated with the new wire may be checked, in order to verify that thenew wire specifes hardware device class information and that the(possibly new) specified hardware device class still has a settableproperty called “REG1”. If it is determined that this is not the case,then the programming environment may visually or otherwise indicate atype error.

FIG. 12 is a flowchart diagram illustrating one embodiment of a methodfor performing step 606 of FIG. 11, in which it is determined whether amethod/property currently selected for a hardware device node is a validmethod/property for a hardware device class with which the node isassociated.

In step 220, information identifying the method/property currentlyselected for the hardware device node and the hardware device class withwhich the node is associated may be passed to an object manager. In oneembodiment, information identifying a type library with which thehardware device class is associated may also be passed to the objectmanager.

The object manager may then return a value indicating whether or not themethod/property is a valid method/property for the hardware deviceclass, i.e., whether or not the hardware device class defines themethod/property. As shown in step 222, the object manager may determinea list of all the valid methods/properties of the hardware device class.For example, as described above, in one embodiment the hardware deviceclass is defined or described in a type library, and the object managermay query the type library to determine the valid methods/properties.

In step 228, the object manager may determine whether the currentlyselected method/property is included in the list of validmethods/properties. If so, then in step 230 a value indicating a validmethod/property may be returned. Otherwise, in step 232, a valueindicating an invalid method/property may be returned.

Although the system and method of the present invention has beendescribed in connection with the preferred embodiment, it is notintended to be limited to the specific form set forth herein, but on thecontrary, it is intended to cover such alternatives, modifications, andequivalents, as can be reasonably included within the spirit and scopeof the invention as defined by the appended claims.

1. A method for creating a graphical program which performs hardwareregister accesses in a hardware device, wherein the method operates in acomputer including a display screen and a user input device, the methodcomprising: storing a description of the hardware device in thecomputer, wherein the description includes mnemonic names of hardwareregisters; displaying on the screen a register access node in thegraphical program in response to user input; and configuring theregister access node to access one or more hardware registers of thehardware device, wherein said configuring includes accessing thedescription of the hardware device for information regarding the one ormore hardware registers of the hardware device; wherein said configuringthe register access node includes: displaying a list of the mnemonicnames of hardware registers on the displace; and receiving user inputselecting one or more of the mnemonic names of hardware registers foraccess; wherein, during execution of the graphical program, the registeraccess node is operable to access the one or more hardware registers ofthe hardware device based on the information accessed from thedescription of the hardware device.
 2. The method of claim 1, whereinsaid configuring the register access node includes: displaying a list ofhardware registers; and receiving user input to select one or more ofthe hardware registers from the list of hardware registers.
 3. Themethod of claim 1, wherein said configuring the register access node toaccess one or more hardware registers of the hardware device comprisesconfiguring the register access node to access selected hardwareregisters described in the description of the hardware device.
 4. Themethod of claim 1, wherein the description further includes mnemonicnames of fields in the hardware registers; wherein said configuring theregister access node includes: displaying a list of the mnemonic namesof fields in the hardware registers on the display; and receiving userinput selecting one or more of the mnemonic names of fields in thehardware registers for access.
 5. The method of claim 1, wherein saidconfiguring the register access node comprises: displaying an icon onthe graphical program which references register access nodeconfiguration information; and connecting the icon to the registeraccess node.
 6. The method of claim 5, wherein the icon is a hardwareopen node.
 7. The method of claim 1, wherein said register access nodecomprises one or more input terminals, the method further comprising:configuring the one or more input terminals to write to a hardwareregister of the hardware device.
 8. The method of claim 1, wherein saidregister access node comprises one or more output terminals, the methodfurther comprising: configuring the one or more output terminals to reada hardware register of the hardware device.
 9. The method of claim 1,further comprising: displaying on the screen a first node in response touser input, wherein the first node references the hardware device; andconnecting the first node to the register access node, wherein saidconnecting provides the register access node with information regardingthe hardware device.
 10. The method of claim 9, wherein the first nodeis a hardware refnum node which references the description of thehardware device.
 11. The method of claim 9, wherein said connecting thefirst node to the register access node includes displaying on the screena wire connecting the first node to the register access node.
 12. Themethod of claim 1, further comprising: constructing executioninstructions in response to the graphical program, wherein the executioninstructions are executable to access hardware registers of the hardwaredevice.
 13. The method of claim 12, further comprising: executing saidexecution instructions, wherein the register access node accesseshardware registers of the hardware device during said executing.
 14. Themethod of claim 1, wherein the graphical program is operable to accesshardware registers of the hardware device for performing instrumentationfunctions on an instrument.
 15. A method for creating a graphicalprogram which performs hardware register accesses in a hardware device,wherein the method operates in a computer including a display and a userinput device, the method comprising: storing a description of thehardware device, wherein the description includes mnemonic names ofhardware registers; displaying one the screen a first node in responseto user input, wherein the first node references the description of thehardware device; displaying on the screen a register access node inresponse to user input, wherein the register access node is operable toaccess the hardware device; configuring the register access node inresponse to user input, wherein said configuring comprises: displaying alist of the mnemonic names of hardware registers on the display; andreceiving user input selecting one or more of the mnemonic names ofhardware registers for access; connecting the first node to the registeraccess node in response to user input, wherein the first node isoperable to provide the description of the hardware device to theregister access node; wherein the register access node receives thedescription, wherein the register access node is operable to accesshardware registers of the hardware device during execution of thegraphical program based on the description of the hardware device. 16.The method of claim 15, the wherein said configuring includes accessingthe description of the hardware device for information regarding theselected hardware registers.
 17. The method of claim 15, furthercomprising: displaying selected mnemonic names of hardware registers onthe display aver said receiving user input selecting one or more of themnemonic names of hardware registers for access.
 18. The method of claim15, wherein the description further includes mnemonic names of fields inthe hardware registers; wherein said configuring the register accessnode includes: displaying a list of the mnemonic names of fields in thehardware registers on the display; and receiving user input selectingone or more of the mnemonic names of fields in the hardware registersfor access.
 19. The method of claim 15, further comprising: displayingon the screen a list of descriptions of available hardware devices;selecting the description from the list of descriptions.
 20. The methodof claim 15, wherein said register access node comprises one or moreinput terminals, wherein, for each input terminal, the method furthercomprises: configuring each input terminal to write to a hardwareregister of the hardware device.
 21. The method of claim 15, whereinsaid register access node comprises one or more output terminals,wherein, for each output terminal, the method further comprises:configuring said each output terminal to read a hardware register of thehardware device.
 22. The method of claim 15, wherein receiving userinput further comprises: selecting a first hardware register from saidlist of hardware registers; associating a first terminal of the registeraccess node with said first hardware register; selecting the firstterminal as a read or a write terminal; connecting the first terminal toa node in the graphical program; and repeating the above steps for oneor more hardware registers of the hardware device.
 23. The method ofclaim 22, wherein the register access node is a growable node which maycomprise a variable number of user selected terminals.
 24. The method ofclaim 15, further comprising: displaying a name of the hardwaredescription on the register access node in response to connecting thefirst node to the register access node.
 25. The method of claim 15,wherein the first node is a hardware open node.
 26. The method of claim25, further comprising: displaying on the screen a hardware refnum nodein response to user input, wherein the hardware refnum node referencesthe description of the hardware device; and connecting the hardwarerefnum node to the first node, wherein said connecting provides thefirst node with a reference to the description of the hardware device.27. The method of claim 15, wherein the first node is a hardware refnumnode which references the description of the hardware device.
 28. Themethod of claim 15, wherein said connecting the first node to theregister access node includes displaying on the screen a wire connectingthe first node to the register access node.
 29. The method of claim 15,further comprising: constructing execution instructions in response tothe graphical program, wherein the execution instructions are executableto access hardware registers of the hardware device.
 30. The method ofclaim 29, further comprising: executing said execution instructions,wherein the register access node accesses hardware registers of thehardware device during said executing.
 31. The method of claim 15,wherein the graphical program is operable to access hardware registersof the hardware device for performing instrumentation functions on aninstrument.
 32. A method for creating a graphical program which performshardware register accesses in a hardware device, wherein the methodoperates in a computer including a display and a user input device, themethod comprising: storing a description of the hardware device, whereinthe description includes mnemonic names of hardware registers;displaying on the screen a register access node in the graphical programin response to user input, wherein the register access node is operableto access the hardware device; connecting an input of the registeraccess node to receive the description of the hardware device inresponse to user input; and configuring the register access node toaccess selected hardware registers described in the description of thehardware device in response to user input, wherein said configuringincludes accessing the description of the hardware device forinformation regarding the selected hardware registers of the hardwaredevice; wherein said configuring comprises: displaying a list of themnemonic names of hardware registers on the receiving user inputselecting one or more of the mnemonic names of hardware registers foraccess; wherein the register access node is operable to access theselected hardware registers of the hardware device during execution ofthe graphical program based on the information.
 33. A memory medium forperforming hardware register accesses in a hardware device, the memorymedium comprising program instructions executable by a processor to:display on the screen a register access node in the graphical program inresponse to user input; and configure the register access node to accessone or more hardware registers of the hardware device, wherein, inconfiguring the register access node to access the one or more hardwareregisters of the hardware device, the program instructions areexecutable by the processor to access a description of the hardwaredevice for information regarding the one or more hardware registers ofthe hardware device, wherein the description includes mnemonic names ofhardware registers; wherein said configuring the register access node,the program instructions are executable to: display a list of themnemonic names of hardware registers on the display; and receive userinput selecting one or more of the mnemonic names of hardware registersfor access; wherein, during execution of the graphical program, theregister access node is operable to access the one or more hardwareregisters of the hardware device based on the information accessed fromthe description of the hardware device.
 34. The memory medium of claim33, wherein in performing said configuring the register access node, theprogram instructions are executable by the processor to: display a listof hardware registers; and receive user input to select one or more ofthe hardware registers from the list of hardware registers.
 35. Thememory medium of claim 33, further comprising program instructionsexecutable by the processor to: store the description of the hardwaredevice in the computer; wherein the register access node uses thedescription of the hardware device to access hardware registers of thehardware device during execution of the graphical program.
 36. Thememory medium of claim 35, wherein said configuring the register accessnode to access one or more hardware registers of the hardware devicecomprises configuring the register access node to access selectedhardware registers described in the description of the hardware device.37. The memory medium of claim 33, wherein said configuring the registeraccess node comprises: displaying an icon on the graphical program whichreferences register access node configuration information; andconnecting the icon to the register access node in response to userinput.
 38. The memory medium of claim 33, further comprising programinstructions executable by the processor to: construct executioninstructions in response to the graphical program, wherein the executioninstructions are executable to access hardware registers of the hardwaredevice.
 39. A system for performing hardware register accesses in ahardware device, the system comprising: a computer including a processorcoupled to a memory; and a hardware device coupled to the computer;wherein the processor is operable to execute program instructions storedin the memory to: response to user input; and display on the screen aregister access node in a graphical program, in configure the registeraccess node to access one or more hardware registers of the hardwaredevice, wherein, in configuring the register access node to access theone or more hardware registers of the hardware device, the processor isoperable to execute the program instructions to access a description ofthe hardware device for information regarding the one or more hardwareregisters of the hardware device wherein the description includesmnemonic names of hardware registers; wherein, in said configuring theregister access node, the processor is operable to: display a list ofthe mnemonic names of hardware registers on the dig play; and receiveuser input selecting one or more of the mnemonic names of hardwareregisters for access; wherein, during execution of the graphicalprogram, the register access node is operable to access the one or morehardware registers of the hardware device based on the informationaccessed from the description of the hardware device.
 40. The system ofclaim 39, wherein in performing said configuring the register accessnode, the processor is operable to execute program instructions to:display a list of hardware registers; and receive user input to selectone or more of the hardware registers from the list of hardwareregisters.
 41. The system of claim 39, wherein the processor is furtheroperable to execute program instructions stored in the memory to: storethe description of the hardware device; wherein the register access nodeuses the description of the hardware device to access hardware registersof the hardware device during execution of the graphical program. 42.The system of claim 41, wherein said configuring the register accessnode to access one or more hardware registers of the hardware devicecomprises configuring the register access node to access selectedhardware registers described in the description of the hardware device.43. The system of claim 39, wherein the processor is further operable toexecute program instructions stored in the memory to: constructexecution instructions in response to the graphical program, wherein theexecution instructions are executable to access hardware registers ofthe hardware device.
 44. A method for creating a graphical program whichperforms hardware register accesses in a hardware device, wherein themethod operates in a computer including a display screen and a userinput device, the method comprising: storing a description of thehardware device in the computer, wherein the description includesmnemonic names of hardware registers: displaying on the screen aregister access node in the graphical program in response to user input;and configuring the register access node to access one or more hardwareregisters of the hardware device; wherein said configuring the registeraccess node includes: displaying a list of the mnemonic names ofhardware registers on the display; and receiving user input selectingone or more of the mnemonic names of hardware registers for access:wherein, during execution of the graphical program, the register accessnode is operable to access the one or more hardware registers of thehardware device.